<?php

include './includes.php';


$user = $_SESSION['user'];
if (isset($_SESSION['user']))
{
    $user = $_SESSION['user'];
    if ($user->getAdmin())
    {
        $noticia = postQuery::create()->findPk($_GET['id']);
        $noticia->delete();                
    }
}

$host3 = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'index.php';
header("Location: http://" . $host3 . $uri . "/" . $extra);
die();
?>
